require.config({
    baseUrl: "../modules",
    paths: {
        jq: "../libs/jquery.2.2.4",
        getData: "getData",
        render: "pag1Render",
        addlist: "addList"
    }
})
require(["jq", "getData", "render", "addlist"], function (_, getData, render, addlist) {
    //商品数据路径
    const url = "http://localhost:3000/api?type=getGoods";
    //开启ajax请求商品数据
    getData(url).then((res) => {
        //页面渲染
        render(res, $(".goods"));
        //绑定事件
        $(".goods").on("click", ".add", function () {
            //添加到localstorage里
            addlist($(this))
        })
    })
})